#!/usr/bin/python3

import psycopg2
conn = psycopg2.connect('dbname=pytest')
cursor = conn.cursor()
cursor.execute('SELECT empid, lastname, firstname, salary FROM employees')
result = cursor.fetchall()
for data in result:
   print(data[0], data[1], data[2], data[3])
cursor.close()
conn.close()
